<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateGuildWithdrawal extends Migration
{
    protected $connection = 'guild';

    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('guild_withdrawal', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->default(0)->comment('用户ID');
            $table->decimal('withdraw_rmb', 20)->default(0)->comment('提现的现金');
            $table->decimal('reality_rmb', 20)->default(0)->comment('理应到账现金');
            $table->decimal('service_charge', 4, 3)->default(0)->comment('提现手续费');
            $table->string('withdraw_account', 30)->default('')->comment('提款账号');
            $table->string('withdraw_real_name', 30)->default('')->comment('提款人(身份证姓名)');
            $table->string('withdraw_id_card', 30)->default('')->comment('提款人身份证号码');
            $table->tinyInteger('withdraw_type')->default(0)->comment('提现方式：1=银行卡 2=支付宝');
            $table->tinyInteger('withdraw_account_type')->default(0)->comment('到账方式：1=当天 2=下个结算周期');
            $table->tinyInteger('status')->default(0)->comment('状态码');
            $table->string('yzh_order_id', 30)->default('')->comment('云账户提现订单ID');
            $table->string('yzh_detail', 30)->default('')->comment('云账户回调结果');
            $table->string('withdraw_way', 10)->default('')->comment('提现方式：yzh,wechat,alipay');
            $table->tinyInteger('account_type')->default(0)->comment('到账方式');
            $table->string('out_trans_id', 50)->default('')->comment('提现交易单号');
            $table->tinyInteger('subject')->default(0)->comment('提现主体：0心友，1芯米');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('guild_withdrawal');
    }
}
